#pragma once 
#include <string>
#include <vector>
#include <memory>

namespace TinyRPC{

class Buffer{
public:
    Buffer();
    std::string read();
    void append(char* str, int strlen);
    void append(const std::string& str);
    char* charAt(int idx);
    int size();
    
private:
    int m_writeIndex;
    int m_readIndex;
    std::vector<char> m_buf;
};

using BufferPtr = std::shared_ptr<Buffer>;
}